$(function(){
	var admin_id = getCookie('admin_id');
	if(!admin_id){
		window.location.replace('login.html');
	}
	document.getElementById("uid").value = admin_id;
	var elem = document.querySelector('.js-switch');
    var switchery = new Switchery(elem, {
        color: '#1AB394'
    });
	//提交表单
   $("#submit").click(function(){
   		 if($("#signupForm").valid()){
          var query = $("#signupForm").serialize();
          ajax_post(ApiUrl + "/registration","registration.html",query);
    	}
   });
   var icon = "<i class='fa fa-times-circle'></i> ";
    $("#signupForm").validate({
        rules: {
            memo: {
                required: true
            }
        },
        messages: {
            memo: {
                required: icon+ "请输入登记说明！"
            }
        }
    });
});